package com.ruoyi.message.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.message.mapper.TMessageMapper;
import com.ruoyi.message.domain.TMessage;
import com.ruoyi.message.service.ITMessageService;

/**
 * 消息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
public class TMessageServiceImpl implements ITMessageService 
{
    @Autowired
    private TMessageMapper tMessageMapper;

    /**
     * 查询消息
     * 
     * @param id 消息主键
     * @return 消息
     */
    @Override
    public TMessage selectTMessageById(Long id)
    {
        return tMessageMapper.selectTMessageById(id);
    }

    /**
     * 查询消息列表
     * 
     * @param tMessage 消息
     * @return 消息
     */
    @Override
    public List<TMessage> selectTMessageList(TMessage tMessage)
    {
        return tMessageMapper.selectTMessageList(tMessage);
    }

    /**
     * 新增消息
     * 
     * @param tMessage 消息
     * @return 结果
     */
    @Override
    public int insertTMessage(TMessage tMessage)
    {
        tMessage.setCreateTime(DateUtils.getNowDate());
        return tMessageMapper.insertTMessage(tMessage);
    }

    /**
     * 修改消息
     * 
     * @param tMessage 消息
     * @return 结果
     */
    @Override
    public int updateTMessage(TMessage tMessage)
    {
        tMessage.setUpdateTime(DateUtils.getNowDate());
        return tMessageMapper.updateTMessage(tMessage);
    }

    /**
     * 批量删除消息
     * 
     * @param ids 需要删除的消息主键
     * @return 结果
     */
    @Override
    public int deleteTMessageByIds(Long[] ids)
    {
        return tMessageMapper.deleteTMessageByIds(ids);
    }

    /**
     * 删除消息信息
     * 
     * @param id 消息主键
     * @return 结果
     */
    @Override
    public int deleteTMessageById(Long id)
    {
        return tMessageMapper.deleteTMessageById(id);
    }

    @Override
    public int insertBatchMessages(List<TMessage> list) {
        return tMessageMapper.insertBatchMessages(list);
    }
}
